
CC = cl.exe
LINK = link.exe
RANLIB = lib.exe

BINS = lua.lib lua.exe luac.exe
SRCS = $(wildcard *.c)
OBJS = $(SRCS:.c=.obj)

OBJFLAGS= /c /I"./"
LINKFLAGS=/nodefaultlib:libcmt.lib


all:$(BINS)

lua.lib:$(OBJS)
	$(RANLIB) /out:$@ $^
lua.exe: lua.lib lua.obj
	$(LINK) /OUT:$@ $^
luac.exe: lua.lib luac.obj
	$(LINK) /out:$@ $^
lua.obj:exec/lua.c
luac.obj:exec/luac.c
%.obj:%.c
	$(CC) $(OBJFLAGS) $<
clean:
	$(RM) $(BINS) $(OBJS)